<form class="layui-form layui-card" method="post">
    <div class="layui-card-body padding-left-40">
      <div class="layui-form-item">
        <label class="layui-form-label label-required-next">{:lang('姓名')}</label>
        <div class="layui-input-block">
          <input type="text" name="true_name" lay-verify="required" placeholder="{:lang('请输入您的真实姓名')}" autocomplete="off" class="layui-input" value="{$vo.true_name|default=''}">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label label-required-next">{:lang('头像')}</label>
        <div class="layui-upload">
          <button type="button" class="layui-btn" data-file='one' data-type='png,jpg,gif,jpeg' data-field='avatar'>
            <i class="layui-icon layui-icon-upload"></i>{:lang('上传头像')}
          </button>
          <input type="hidden" name="avatar" value="{$vo.avatar|default=''}">
          <img name="avatar_url" src="{$vo.avatar|default=''}" alt="{:lang('头像预览')}" style="width: 109px;height: 109px;" class="layui-circle">
      </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label label-required-next">{:lang('手机号')}</label>
        <div class="layui-input-block">
          <input type="text" name="mobile" lay-verify="required" placeholder="{:lang('请输入手机号')}" autocomplete="off" class="layui-input" value="{$vo.mobile|default=''}">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">{:lang('邮箱')}</label>
        <div class="layui-input-block">
          <input type="text" name="email" lay-verify="" placeholder="{:lang('请输入邮箱')}" autocomplete="off" class="layui-input" value="{$vo.email|default=''}">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label label-required-next">{:lang('昵称')}</label>
        <div class="layui-input-block">
          <input type="text" name="nick_name" lay-verify="required" placeholder="{:lang('请输入昵称')}" autocomplete="off" class="layui-input" value="{$vo.nick_name|default=''}">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label label-required-next">{:lang('学校/单位')}</label>
        <div class="layui-input-block">
            {if !empty($platforms) }
                <select name="job_place" lay-verify="required" lay-search>
                  {foreach $platforms as $k => $v}
                    <option value="{$v.id}" {if $vo.job_place == $v.id}selected{/if}>{$v.title}</option>
                  {/foreach}
                </select>
            {/if}
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">{:lang('院系/部门')}</label>
        <div class="layui-input-block">
          <input type="text" name="job_depart" lay-verify="" placeholder="{:lang('请输入院系/部门')}" autocomplete="off" class="layui-input" value="{$vo.job_depart|default=''}">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">{:lang('专业')}</label>
        <div class="layui-input-block">
          <input type="text" name="major" lay-verify="" placeholder="{:lang('请输入专业')}" autocomplete="off" class="layui-input" value="{$vo.major|default=''}">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label label-required-next">{:lang('学号/工号')}</label>
        <div class="layui-input-block">
          <input type="text" name="job_number" lay-verify="" placeholder="{:lang('请输入学号/工号')}" autocomplete="off" class="layui-input" value="{$vo.job_number|default=''}">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label label-required-next">{:lang('性别')}</label>
        <div class="layui-input-block">
          {if !empty($sexArr) }
            {foreach $sexArr as $k => $v}
          <input type="radio" name="sex" value="{$k|default=''}" title="{$v|default=''}" {if $vo.sex == $k }checked{/if}> 
          {/foreach}
          {/if}
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label label-required-next">{:lang('最高学历')}</label>
        <div class="layui-input-block">
          <select name="edu_background" lay-filter="edu_background">
            {if !empty($backGroundArr) }
            {foreach $backGroundArr as $k => $v}
            <option value="{$k|default=''}" {if $vo.edu_background == $k }selected {/if}>{$v|default=''}</option>
            {/foreach}
            {/if}
          </select>
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">{:lang('简介')}</label>
        <div class="layui-input-block">
          <textarea placeholder="{:lang('请输入简介')}" class="layui-textarea" name="intro">{$vo.intro|default=''}</textarea>
        </div>
        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="save">{:lang('保存')}</button>
          <button type="reset" class="layui-btn layui-btn-primary" data-close>{:lang('取消')}</button>
        </div>
      </div>
    </div>
</form>
<style type="text/css">
  .uploadimage {
    width: 76px;
    height: 76px;
    cursor: pointer;
    display: inline-block;
    border-radius: 3px;
  }
</style>
<script type="text/javascript">
  $(function () {
    // 捕获上传文件
    $('form input[name=avatar]').on('change', function () {
        // 文件地址变量事件
        $('form img[name=avatar_url]').attr('src', this.value);
    });
  })
</script>